class_name PlayerStateShooting
extends PlayerState

func _enter_tree() -> void:
	animation_player.play("kick")
	
func on_animation_complete() -> void:
	if player.is_cpu():
		state_transition(Player.State.RECOVERING)
	else:
		state_transition(Player.State.MOVING)
	shoot_ball()
	
func shoot_ball() -> void:
	SoundPlayer.play(SoundPlayer.Sound.SHOOT)
	ball.shoot(state_data.shoot_direction * state_data.shoot_power)
